package com.lingxu.module.homeIndex.entity;

/**
 * @Title: ParamsDTO
 * @Package: com.lingxu.module.homeIndex.entity
 * @Author: ysj闫世杰
 * @Email: 1105324813@qq.com
 * @Date: Created in 2023/7/27 9:58
 * @Description:
 * @Version: 1.0.0
 */

public class ParamsDTO {
    private String areaCode;
    private String dateTime;
    private String startTime;
    private String endTime;
    private String year;
    private String code;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }


    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }


    public String getStartTime() {
        if(dateTime.length() > 4){
            startTime = dateTime.substring(0,7);
        }
        return startTime;
    }
    public void setStartTime(String startTime) {

        this.startTime = startTime;
    }

    public String getEndTime() {
        if(dateTime.length() > 4){
            String year = dateTime.substring(0,4);
            String month = dateTime.split("~")[1];
            endTime =  year + "-" + month;
        }
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getYear() {
        if(dateTime.length() == 4){
            year = dateTime;
        }
        return year;
    }
    public void setYear(String year) {
        this.year = year;
    }
}
